﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace STF.Blog.Model
{
    /// <summary>
    /// 评论表
    /// </summary>
    public class Comment:BaseEntity
    {
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "文章编号")]
        [ForeignKey(nameof(Blog))]
        public int Bid { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(2000), Column(TypeName = "varchar(2000)")]
        [Display(Name = "评论内容")]
        public string Content { get; set; }

        [Display(Name ="点赞数")]
        public int LikeSum { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "用户编号")]
        //[ForeignKey(nameof(Users))]
        public int Uid { get; set; }    // 账户表外键

        public Blog Blog { get; set; }
        //public Users User { get; set; }
    }
}
